import unittest
from flamechess.jiuqi import Game


class MyTestCase(unittest.TestCase):
    def setUp(self) -> None:
        self.game = Game()
        self.s1 = [[1, 1, 0, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, -1],
                   [1, 1, 0, 0, -1, 1, 1, 0, 0, -1, -1, 1, -1, -1],
                   [1, 0, 0, -1, 0, -1, 1, 1, -1, -1, -1, -1, 0, 1],
                   [1, -1, 1, 0, 0, 1, 1, 0, -1, 0, -1, 1, 0, -1],
                   [1, 1, 0, 1, -1, 0, -1, -1, 0, -1, -1, -1, 0, 0],
                   [1, 1, 0, 1, 1, 1, -1, 0, 0, -1, 0, 0, -1, 0],
                   [1, 0, 0, 0, -1, 0, -1, 1, 1, -1, 0, -1, -1, -1],
                   [-1, 0, 1, 0, 0, 1, 0, 0, 1, -1, 0, 1, 0, 0],
                   [1, 1, 0, 1, 1, 1, -1, 0, 1, 0, 0, -1, -1, -1],
                   [1, 1, 0, 1, 0, 1, -1, 0, 1, 0, 0, 0, 0, -1],
                   [0, 0, -1, 0, 0, -1, -1, 0, 0, -1, -1, 1, 0, -1],
                   [-1, 0, -1, 0, -1, 0, -1, 1, 0, 1, -1, 0, -1, 0],
                   [-1, -1, 1, 0, -1, 0, 1, 1, -1, 0, 1, 1, -1, -1],
                   [-1, 1, -1, -1, 0, 0, 1, 0, -1, 0, -1, 0, 1, 0]]
        self.s2 = [[-1, 0, 1, -1, -1, -1, 1, 0, 1, -1, 0, -1, -1, 0], [-1, -1, -1, 1, 0, -1, -1, -1, 1, 1, 1, 1, 0, 1],
                   [1, -1, -1, 1, 0, 1, -1, -1, -1, 1, 1, -1, 1, 0], [-1, -1, 0, 1, -1, 1, 0, 0, 0, 0, -1, 0, 1, -1],
                   [0, -1, 1, 1, 0, -1, 0, -1, 0, 1, -1, -1, -1, 1], [-1, 0, -1, 0, 0, -1, 1, 1, 1, 0, 0, 0, -1, 1],
                   [-1, 0, 1, 0, 0, 1, 1, 0, -1, -1, 1, 1, 1, 0], [-1, 1, 0, -1, -1, -1, 1, -1, -1, 0, 1, 0, -1, -1],
                   [-1, 0, 0, 0, 1, -1, 0, -1, -1, -1, 0, 0, 0, 1], [-1, 1, 1, 1, -1, 1, -1, -1, 0, 1, 0, 1, -1, 1],
                   [1, -1, 1, 1, -1, 1, 0, 1, -1, 0, 0, 0, 1, 0], [1, 1, -1, -1, -1, -1, 0, -1, 0, 1, 0, -1, -1, 0],
                   [0, -1, 1, 0, -1, -1, 0, 1, 1, -1, 0, 1, 1, 0], [1, 0, -1, 0, -1, 1, 1, -1, 0, -1, 1, -1, -1, 0]]
        self.s3 = [[0, 0, 0, 0, 0, 1, -1, 1, -1, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

    def test_available_actions(self):
        args = [[self.s1, -1, "layout"], [self.s2, 1, "play"], [self.s3, -1, "play"]]
        answers = [[((0, 2), None), ((0, 3), None), ((0, 4), None), ((0, 6), None), ((0, 7), None), ((0, 9), None),
                    ((0, 10), None), ((0, 12), None), ((1, 2), None), ((1, 3), None), ((1, 7), None), ((1, 8), None),
                    ((2, 1), None), ((2, 2), None), ((2, 4), None), ((2, 12), None), ((3, 3), None), ((3, 4), None),
                    ((3, 7), None), ((3, 9), None), ((3, 12), None), ((4, 2), None), ((4, 5), None), ((4, 8), None),
                    ((4, 12), None), ((4, 13), None), ((5, 2), None), ((5, 7), None), ((5, 8), None), ((5, 10), None),
                    ((5, 11), None), ((5, 13), None), ((6, 1), None), ((6, 2), None), ((6, 3), None), ((6, 5), None),
                    ((6, 10), None), ((7, 1), None), ((7, 3), None), ((7, 4), None), ((7, 6), None), ((7, 7), None),
                    ((7, 10), None), ((7, 12), None), ((7, 13), None), ((8, 2), None), ((8, 7), None), ((8, 9), None),
                    ((8, 10), None), ((9, 2), None), ((9, 4), None), ((9, 7), None), ((9, 9), None), ((9, 10), None),
                    ((9, 11), None), ((9, 12), None), ((10, 0), None), ((10, 1), None), ((10, 3), None),
                    ((10, 4), None), ((10, 7), None), ((10, 8), None), ((10, 12), None), ((11, 1), None),
                    ((11, 3), None), ((11, 5), None), ((11, 8), None), ((11, 11), None), ((11, 13), None),
                    ((12, 3), None), ((12, 5), None), ((12, 9), None), ((13, 4), None), ((13, 5), None),
                    ((13, 7), None), ((13, 9), None), ((13, 11), None), ((13, 13), None)],
                   [(((0, 2), (0, 1)), ()), (((0, 6), (0, 7)), ()), (((0, 8), (0, 10)), ((0, 9),)),
                    (((0, 8), (0, 7)), ()), (((1, 3), (1, 4)), ()), (((1, 8), (3, 8)), ((2, 8),)),
                    (((1, 10), (0, 10)), ()), (((1, 11), (3, 11)), ((2, 11),)),
                    (((1, 11), (3, 11), (5, 11)), ((2, 11), (4, 11))), (((1, 11), (3, 11), (3, 9)), ((2, 11), (3, 10))),
                    (((1, 11), (1, 12)), ()), (((1, 13), (1, 12)), ()), (((1, 13), (2, 13)), ()),
                    (((1, 13), (0, 13)), ()), (((2, 0), (4, 0)), ((3, 0),)), (((2, 3), (2, 4)), ()),
                    (((2, 5), (2, 4)), ()), (((2, 9), (3, 9)), ()), (((2, 12), (2, 13)), ()), (((2, 12), (1, 12)), ()),
                    (((3, 3), (3, 2)), ()), (((3, 5), (3, 6)), ()), (((3, 12), (3, 11)), ()),
                    (((4, 2), (4, 0)), ((4, 1),)), (((4, 2), (3, 2)), ()), (((4, 3), (4, 4)), ()),
                    (((4, 3), (5, 3)), ()), (((4, 9), (4, 8)), ()), (((4, 9), (5, 9)), ()), (((4, 9), (3, 9)), ()),
                    (((4, 13), (2, 13)), ((3, 13),)), (((5, 6), (5, 4)), ((5, 5),)), (((5, 6), (4, 6)), ()),
                    (((5, 7), (3, 7)), ((4, 7),)), (((5, 7), (6, 7)), ()), (((5, 8), (5, 9)), ()),
                    (((5, 8), (4, 8)), ()), (((5, 13), (5, 11)), ((5, 12),)),
                    (((5, 13), (5, 11), (3, 11)), ((5, 12), (4, 11))),
                    (((5, 13), (5, 11), (3, 11), (3, 9)), ((5, 12), (4, 11), (3, 10))), (((5, 13), (6, 13)), ()),
                    (((6, 2), (6, 3)), ()), (((6, 2), (6, 1)), ()), (((6, 2), (7, 2)), ()), (((6, 5), (6, 4)), ()),
                    (((6, 6), (6, 7)), ()), (((6, 10), (5, 10)), ()), (((6, 11), (7, 11)), ()),
                    (((6, 11), (5, 11)), ()), (((6, 12), (8, 12)), ((7, 12),)), (((6, 12), (6, 13)), ()),
                    (((7, 1), (7, 2)), ()), (((7, 1), (8, 1)), ()), (((7, 1), (6, 1)), ()), (((7, 6), (8, 6)), ()),
                    (((7, 10), (7, 11)), ()), (((7, 10), (7, 9)), ()), (((7, 10), (8, 10)), ()),
                    (((8, 4), (6, 4)), ((7, 4),)), (((8, 4), (8, 3)), ()), (((8, 13), (6, 13)), ((7, 13),)),
                    (((8, 13), (8, 12)), ()), (((9, 1), (8, 1)), ()), (((9, 2), (8, 2)), ()), (((9, 3), (8, 3)), ()),
                    (((9, 9), (7, 9)), ((8, 9),)), (((9, 9), (7, 9), (5, 9)), ((8, 9), (6, 9))),
                    (((9, 9), (9, 10)), ()), (((9, 9), (9, 8)), ()), (((9, 9), (10, 9)), ()), (((9, 11), (9, 10)), ()),
                    (((9, 11), (10, 11)), ()), (((9, 11), (8, 11)), ()), (((9, 13), (10, 13)), ()),
                    (((10, 3), (12, 3)), ((11, 3),)), (((10, 5), (10, 6)), ()), (((10, 7), (10, 9)), ((10, 8),)),
                    (((10, 7), (10, 6)), ()), (((10, 12), (8, 12)), ((9, 12),)), (((10, 12), (10, 13)), ()),
                    (((10, 12), (10, 11)), ()), (((11, 0), (12, 0)), ()), (((11, 1), (13, 1)), ((12, 1),)),
                    (((11, 1), (13, 1), (13, 3)), ((12, 1), (13, 2))), (((11, 9), (11, 10)), ()),
                    (((11, 9), (11, 8)), ()), (((11, 9), (10, 9)), ()), (((12, 2), (12, 0)), ((12, 1),)),
                    (((12, 2), (12, 3)), ()), (((12, 7), (12, 6)), ()), (((12, 8), (12, 10)), ((12, 9),)),
                    (((12, 8), (13, 8)), ()), (((12, 8), (11, 8)), ()), (((12, 11), (10, 11)), ((11, 11),)),
                    (((12, 11), (12, 10)), ()), (((12, 12), (12, 13)), ()), (((13, 0), (13, 1)), ()),
                    (((13, 0), (12, 0)), ()), (((13, 5), (13, 3)), ((13, 4),)),
                    (((13, 5), (13, 3), (13, 1)), ((13, 4), (13, 2))), (((13, 6), (13, 8)), ((13, 7),)),
                    (((13, 6), (12, 6)), ()), (((13, 10), (13, 8)), ((13, 9),)), (((13, 10), (12, 10)), ())],
                   [(((0, 6), (0, 4)), ((0, 5),)), (((0, 6), (1, 6)), ()), (((0, 8), (0, 9)), ()),
                    (((0, 8), (1, 8)), ()), (((1, 0), (1, 1)), ()), (((1, 0), (2, 0)), ()), (((1, 0), (0, 0)), ()),
                    (((6, 8), (6, 7)), ()), (((6, 8), (7, 8)), ()), (((6, 8), (5, 8)), ()), (((6, 9), (6, 10)), ()),
                    (((6, 9), (5, 9)), ()), (((7, 9), (7, 10)), ()), (((7, 9), (7, 8)), ()), (((7, 9), (8, 9)), ()),
                    (((0, 6), (7, 3)), ()), (((0, 6), (12, 1)), ()), (((0, 6), (11, 11)), ()), (((0, 6), (7, 12)), ()),
                    (((0, 6), (13, 4)), ()), (((0, 6), (12, 12)), ()), (((0, 6), (0, 10)), ()), (((0, 6), (3, 7)), ()),
                    (((0, 6), (2, 5)), ()), (((0, 6), (1, 11)), ()), (((0, 6), (8, 5)), ()), (((0, 6), (4, 0)), ()),
                    (((0, 6), (10, 8)), ()), (((0, 6), (9, 0)), ()), (((0, 6), (5, 5)), ()), (((0, 6), (11, 5)), ()),
                    (((0, 6), (10, 7)), ()), (((0, 6), (7, 6)), ()), (((0, 6), (12, 6)), ()), (((0, 6), (13, 7)), ()),
                    (((0, 6), (4, 10)), ()), (((0, 6), (3, 2)), ()), (((0, 6), (2, 6)), ()), (((0, 6), (8, 2)), ()),
                    (((0, 6), (5, 11)), ()), (((0, 6), (4, 5)), ()), (((0, 6), (10, 13)), ()), (((0, 6), (9, 3)), ()),
                    (((0, 6), (6, 0)), ()), (((0, 6), (11, 0)), ()), (((0, 6), (7, 5)), ()), (((0, 6), (12, 11)), ()),
                    (((0, 6), (13, 10)), ()), (((0, 6), (0, 1)), ()), (((0, 6), (3, 12)), ()), (((0, 6), (1, 12)), ()),
                    (((0, 6), (8, 12)), ()), (((0, 6), (3, 1)), ()), (((0, 6), (2, 11)), ()), (((0, 6), (9, 9)), ()),
                    (((0, 6), (6, 13)), ()), (((0, 6), (13, 0)), ()), (((0, 6), (12, 8)), ()), (((0, 6), (13, 13)), ()),
                    (((0, 6), (3, 11)), ()), (((0, 6), (2, 1)), ()), (((0, 6), (4, 12)), ()), (((0, 6), (2, 12)), ()),
                    (((0, 6), (9, 4)), ()), (((0, 6), (5, 1)), ()), (((0, 6), (10, 3)), ()), (((0, 6), (7, 2)), ()),
                    (((0, 6), (12, 2)), ()), (((0, 6), (11, 10)), ()), (((0, 6), (13, 3)), ()),
                    (((0, 6), (12, 13)), ()), (((0, 6), (1, 5)), ()), (((0, 6), (0, 11)), ()), (((0, 6), (3, 6)), ()),
                    (((0, 6), (2, 2)), ()), (((0, 6), (8, 6)), ()), (((0, 6), (4, 1)), ()), (((0, 6), (10, 9)), ()),
                    (((0, 6), (9, 7)), ()), (((0, 6), (6, 4)), ()), (((0, 6), (5, 4)), ()), (((0, 6), (11, 4)), ()),
                    (((0, 6), (10, 4)), ()), (((0, 6), (7, 1)), ()), (((0, 6), (6, 11)), ()), (((0, 6), (12, 7)), ()),
                    (((0, 6), (11, 9)), ()), (((0, 6), (13, 6)), ()), (((0, 6), (4, 11)), ()), (((0, 6), (3, 5)), ()),
                    (((0, 6), (2, 7)), ()), (((0, 6), (9, 13)), ()), (((0, 6), (8, 3)), ()), (((0, 6), (5, 10)), ()),
                    (((0, 6), (4, 6)), ()), (((0, 6), (10, 10)), ()), (((0, 6), (9, 2)), ()), (((0, 6), (6, 1)), ()),
                    (((0, 6), (5, 7)), ()), (((0, 6), (11, 3)), ()), (((0, 6), (7, 4)), ()), (((0, 6), (12, 4)), ()),
                    (((0, 6), (13, 9)), ()), (((0, 6), (0, 2)), ()), (((0, 6), (1, 3)), ()), (((0, 6), (8, 13)), ()),
                    (((0, 6), (4, 8)), ()), (((0, 6), (3, 0)), ()), (((0, 6), (2, 8)), ()), (((0, 6), (9, 8)), ()),
                    (((0, 6), (8, 0)), ()), (((0, 6), (5, 13)), ()), (((0, 6), (6, 2)), ()), (((0, 6), (7, 11)), ()),
                    (((0, 6), (12, 9)), ()), (((0, 6), (13, 12)), ()), (((0, 6), (3, 10)), ()), (((0, 6), (8, 10)), ()),
                    (((0, 6), (4, 13)), ()), (((0, 6), (2, 13)), ()), (((0, 6), (9, 11)), ()), (((0, 6), (5, 0)), ()),
                    (((0, 6), (10, 0)), ()), (((0, 6), (12, 3)), ()), (((0, 6), (11, 13)), ()), (((0, 6), (13, 2)), ()),
                    (((0, 6), (1, 4)), ()), (((0, 6), (0, 12)), ()), (((0, 6), (3, 9)), ()), (((0, 6), (2, 3)), ()),
                    (((0, 6), (1, 9)), ()), (((0, 6), (8, 7)), ()), (((0, 6), (4, 2)), ()), (((0, 6), (9, 6)), ()),
                    (((0, 6), (6, 5)), ()), (((0, 6), (5, 3)), ()), (((0, 6), (11, 7)), ()), (((0, 6), (10, 5)), ()),
                    (((0, 6), (7, 0)), ()), (((0, 6), (12, 0)), ()), (((0, 6), (11, 8)), ()), (((0, 6), (7, 13)), ()),
                    (((0, 6), (13, 5)), ()), (((0, 6), (1, 7)), ()), (((0, 6), (3, 4)), ()), (((0, 6), (2, 4)), ()),
                    (((0, 6), (9, 12)), ()), (((0, 6), (8, 4)), ()), (((0, 6), (4, 7)), ()), (((0, 6), (10, 11)), ()),
                    (((0, 6), (9, 1)), ()), (((0, 6), (6, 6)), ()), (((0, 6), (5, 6)), ()), (((0, 6), (11, 2)), ()),
                    (((0, 6), (10, 6)), ()), (((0, 6), (7, 7)), ()), (((0, 6), (12, 5)), ()), (((0, 6), (13, 8)), ()),
                    (((0, 6), (0, 3)), ()), (((0, 6), (1, 2)), ()), (((0, 6), (4, 9)), ()), (((0, 6), (2, 9)), ()),
                    (((0, 6), (8, 1)), ()), (((0, 6), (5, 12)), ()), (((0, 6), (4, 4)), ()), (((0, 6), (10, 12)), ()),
                    (((0, 6), (6, 3)), ()), (((0, 6), (11, 1)), ()), (((0, 6), (12, 10)), ()), (((0, 6), (13, 11)), ()),
                    (((0, 6), (3, 13)), ()), (((0, 6), (1, 13)), ()), (((0, 6), (8, 11)), ()), (((0, 6), (2, 10)), ()),
                    (((0, 6), (9, 10)), ()), (((0, 6), (10, 1)), ()), (((0, 6), (6, 12)), ()), (((0, 6), (11, 12)), ()),
                    (((0, 6), (13, 1)), ()), (((0, 6), (0, 13)), ()), (((0, 6), (3, 8)), ()), (((0, 6), (4, 3)), ()),
                    (((0, 6), (9, 5)), ()), (((0, 6), (5, 2)), ()), (((0, 6), (11, 6)), ()), (((0, 6), (10, 2)), ()),
                    (((0, 8), (7, 3)), ()), (((0, 8), (12, 1)), ()), (((0, 8), (11, 11)), ()), (((0, 8), (7, 12)), ()),
                    (((0, 8), (13, 4)), ()), (((0, 8), (12, 12)), ()), (((0, 8), (0, 10)), ()), (((0, 8), (3, 7)), ()),
                    (((0, 8), (2, 5)), ()), (((0, 8), (1, 11)), ()), (((0, 8), (8, 5)), ()), (((0, 8), (4, 0)), ()),
                    (((0, 8), (10, 8)), ()), (((0, 8), (9, 0)), ()), (((0, 8), (5, 5)), ()), (((0, 8), (11, 5)), ()),
                    (((0, 8), (10, 7)), ()), (((0, 8), (7, 6)), ()), (((0, 8), (12, 6)), ()), (((0, 8), (13, 7)), ()),
                    (((0, 8), (4, 10)), ()), (((0, 8), (3, 2)), ()), (((0, 8), (2, 6)), ()), (((0, 8), (8, 2)), ()),
                    (((0, 8), (5, 11)), ()), (((0, 8), (4, 5)), ()), (((0, 8), (10, 13)), ()), (((0, 8), (9, 3)), ()),
                    (((0, 8), (6, 0)), ()), (((0, 8), (11, 0)), ()), (((0, 8), (7, 5)), ()), (((0, 8), (12, 11)), ()),
                    (((0, 8), (13, 10)), ()), (((0, 8), (0, 1)), ()), (((0, 8), (3, 12)), ()), (((0, 8), (1, 12)), ()),
                    (((0, 8), (8, 12)), ()), (((0, 8), (3, 1)), ()), (((0, 8), (2, 11)), ()), (((0, 8), (9, 9)), ()),
                    (((0, 8), (6, 13)), ()), (((0, 8), (13, 0)), ()), (((0, 8), (12, 8)), ()), (((0, 8), (13, 13)), ()),
                    (((0, 8), (3, 11)), ()), (((0, 8), (2, 1)), ()), (((0, 8), (4, 12)), ()), (((0, 8), (2, 12)), ()),
                    (((0, 8), (9, 4)), ()), (((0, 8), (5, 1)), ()), (((0, 8), (10, 3)), ()), (((0, 8), (7, 2)), ()),
                    (((0, 8), (12, 2)), ()), (((0, 8), (11, 10)), ()), (((0, 8), (13, 3)), ()),
                    (((0, 8), (12, 13)), ()), (((0, 8), (1, 5)), ()), (((0, 8), (0, 11)), ()), (((0, 8), (3, 6)), ()),
                    (((0, 8), (2, 2)), ()), (((0, 8), (8, 6)), ()), (((0, 8), (4, 1)), ()), (((0, 8), (10, 9)), ()),
                    (((0, 8), (9, 7)), ()), (((0, 8), (6, 4)), ()), (((0, 8), (5, 4)), ()), (((0, 8), (11, 4)), ()),
                    (((0, 8), (10, 4)), ()), (((0, 8), (7, 1)), ()), (((0, 8), (6, 11)), ()), (((0, 8), (12, 7)), ()),
                    (((0, 8), (11, 9)), ()), (((0, 8), (13, 6)), ()), (((0, 8), (4, 11)), ()), (((0, 8), (3, 5)), ()),
                    (((0, 8), (2, 7)), ()), (((0, 8), (9, 13)), ()), (((0, 8), (8, 3)), ()), (((0, 8), (5, 10)), ()),
                    (((0, 8), (4, 6)), ()), (((0, 8), (10, 10)), ()), (((0, 8), (9, 2)), ()), (((0, 8), (6, 1)), ()),
                    (((0, 8), (5, 7)), ()), (((0, 8), (11, 3)), ()), (((0, 8), (7, 4)), ()), (((0, 8), (12, 4)), ()),
                    (((0, 8), (13, 9)), ()), (((0, 8), (0, 2)), ()), (((0, 8), (1, 3)), ()), (((0, 8), (8, 13)), ()),
                    (((0, 8), (4, 8)), ()), (((0, 8), (3, 0)), ()), (((0, 8), (2, 8)), ()), (((0, 8), (9, 8)), ()),
                    (((0, 8), (8, 0)), ()), (((0, 8), (5, 13)), ()), (((0, 8), (6, 2)), ()), (((0, 8), (7, 11)), ()),
                    (((0, 8), (12, 9)), ()), (((0, 8), (13, 12)), ()), (((0, 8), (3, 10)), ()), (((0, 8), (8, 10)), ()),
                    (((0, 8), (4, 13)), ()), (((0, 8), (2, 13)), ()), (((0, 8), (9, 11)), ()), (((0, 8), (5, 0)), ()),
                    (((0, 8), (10, 0)), ()), (((0, 8), (12, 3)), ()), (((0, 8), (11, 13)), ()), (((0, 8), (13, 2)), ()),
                    (((0, 8), (1, 4)), ()), (((0, 8), (0, 12)), ()), (((0, 8), (3, 9)), ()), (((0, 8), (2, 3)), ()),
                    (((0, 8), (1, 9)), ()), (((0, 8), (8, 7)), ()), (((0, 8), (4, 2)), ()), (((0, 8), (9, 6)), ()),
                    (((0, 8), (6, 5)), ()), (((0, 8), (5, 3)), ()), (((0, 8), (11, 7)), ()), (((0, 8), (10, 5)), ()),
                    (((0, 8), (7, 0)), ()), (((0, 8), (12, 0)), ()), (((0, 8), (11, 8)), ()), (((0, 8), (7, 13)), ()),
                    (((0, 8), (13, 5)), ()), (((0, 8), (1, 7)), ()), (((0, 8), (3, 4)), ()), (((0, 8), (2, 4)), ()),
                    (((0, 8), (9, 12)), ()), (((0, 8), (8, 4)), ()), (((0, 8), (4, 7)), ()), (((0, 8), (10, 11)), ()),
                    (((0, 8), (9, 1)), ()), (((0, 8), (6, 6)), ()), (((0, 8), (5, 6)), ()), (((0, 8), (11, 2)), ()),
                    (((0, 8), (10, 6)), ()), (((0, 8), (7, 7)), ()), (((0, 8), (12, 5)), ()), (((0, 8), (13, 8)), ()),
                    (((0, 8), (0, 3)), ()), (((0, 8), (1, 2)), ()), (((0, 8), (4, 9)), ()), (((0, 8), (2, 9)), ()),
                    (((0, 8), (8, 1)), ()), (((0, 8), (5, 12)), ()), (((0, 8), (4, 4)), ()), (((0, 8), (10, 12)), ()),
                    (((0, 8), (6, 3)), ()), (((0, 8), (11, 1)), ()), (((0, 8), (12, 10)), ()), (((0, 8), (13, 11)), ()),
                    (((0, 8), (3, 13)), ()), (((0, 8), (1, 13)), ()), (((0, 8), (8, 11)), ()), (((0, 8), (2, 10)), ()),
                    (((0, 8), (9, 10)), ()), (((0, 8), (10, 1)), ()), (((0, 8), (6, 12)), ()), (((0, 8), (11, 12)), ()),
                    (((0, 8), (13, 1)), ()), (((0, 8), (0, 13)), ()), (((0, 8), (3, 8)), ()), (((0, 8), (4, 3)), ()),
                    (((0, 8), (9, 5)), ()), (((0, 8), (5, 2)), ()), (((0, 8), (11, 6)), ()), (((0, 8), (10, 2)), ()),
                    (((1, 0), (7, 3)), ()), (((1, 0), (12, 1)), ()), (((1, 0), (11, 11)), ()), (((1, 0), (7, 12)), ()),
                    (((1, 0), (13, 4)), ()), (((1, 0), (12, 12)), ()), (((1, 0), (0, 10)), ()), (((1, 0), (3, 7)), ()),
                    (((1, 0), (2, 5)), ()), (((1, 0), (1, 11)), ()), (((1, 0), (8, 5)), ()), (((1, 0), (4, 0)), ()),
                    (((1, 0), (10, 8)), ()), (((1, 0), (9, 0)), ()), (((1, 0), (5, 5)), ()), (((1, 0), (11, 5)), ()),
                    (((1, 0), (10, 7)), ()), (((1, 0), (7, 6)), ()), (((1, 0), (12, 6)), ()), (((1, 0), (13, 7)), ()),
                    (((1, 0), (4, 10)), ()), (((1, 0), (3, 2)), ()), (((1, 0), (2, 6)), ()), (((1, 0), (8, 2)), ()),
                    (((1, 0), (5, 11)), ()), (((1, 0), (4, 5)), ()), (((1, 0), (10, 13)), ()), (((1, 0), (9, 3)), ()),
                    (((1, 0), (6, 0)), ()), (((1, 0), (11, 0)), ()), (((1, 0), (7, 5)), ()), (((1, 0), (12, 11)), ()),
                    (((1, 0), (13, 10)), ()), (((1, 0), (0, 1)), ()), (((1, 0), (3, 12)), ()), (((1, 0), (1, 12)), ()),
                    (((1, 0), (8, 12)), ()), (((1, 0), (3, 1)), ()), (((1, 0), (2, 11)), ()), (((1, 0), (9, 9)), ()),
                    (((1, 0), (6, 13)), ()), (((1, 0), (13, 0)), ()), (((1, 0), (12, 8)), ()), (((1, 0), (13, 13)), ()),
                    (((1, 0), (3, 11)), ()), (((1, 0), (2, 1)), ()), (((1, 0), (4, 12)), ()), (((1, 0), (2, 12)), ()),
                    (((1, 0), (9, 4)), ()), (((1, 0), (5, 1)), ()), (((1, 0), (10, 3)), ()), (((1, 0), (7, 2)), ()),
                    (((1, 0), (12, 2)), ()), (((1, 0), (11, 10)), ()), (((1, 0), (13, 3)), ()),
                    (((1, 0), (12, 13)), ()), (((1, 0), (1, 5)), ()), (((1, 0), (0, 11)), ()), (((1, 0), (3, 6)), ()),
                    (((1, 0), (2, 2)), ()), (((1, 0), (8, 6)), ()), (((1, 0), (4, 1)), ()), (((1, 0), (10, 9)), ()),
                    (((1, 0), (9, 7)), ()), (((1, 0), (6, 4)), ()), (((1, 0), (5, 4)), ()), (((1, 0), (11, 4)), ()),
                    (((1, 0), (10, 4)), ()), (((1, 0), (7, 1)), ()), (((1, 0), (6, 11)), ()), (((1, 0), (12, 7)), ()),
                    (((1, 0), (11, 9)), ()), (((1, 0), (13, 6)), ()), (((1, 0), (4, 11)), ()), (((1, 0), (3, 5)), ()),
                    (((1, 0), (2, 7)), ()), (((1, 0), (9, 13)), ()), (((1, 0), (8, 3)), ()), (((1, 0), (5, 10)), ()),
                    (((1, 0), (4, 6)), ()), (((1, 0), (10, 10)), ()), (((1, 0), (9, 2)), ()), (((1, 0), (6, 1)), ()),
                    (((1, 0), (5, 7)), ()), (((1, 0), (11, 3)), ()), (((1, 0), (7, 4)), ()), (((1, 0), (12, 4)), ()),
                    (((1, 0), (13, 9)), ()), (((1, 0), (0, 2)), ()), (((1, 0), (1, 3)), ()), (((1, 0), (8, 13)), ()),
                    (((1, 0), (4, 8)), ()), (((1, 0), (3, 0)), ()), (((1, 0), (2, 8)), ()), (((1, 0), (9, 8)), ()),
                    (((1, 0), (8, 0)), ()), (((1, 0), (5, 13)), ()), (((1, 0), (6, 2)), ()), (((1, 0), (7, 11)), ()),
                    (((1, 0), (12, 9)), ()), (((1, 0), (13, 12)), ()), (((1, 0), (3, 10)), ()), (((1, 0), (8, 10)), ()),
                    (((1, 0), (4, 13)), ()), (((1, 0), (2, 13)), ()), (((1, 0), (9, 11)), ()), (((1, 0), (5, 0)), ()),
                    (((1, 0), (10, 0)), ()), (((1, 0), (12, 3)), ()), (((1, 0), (11, 13)), ()), (((1, 0), (13, 2)), ()),
                    (((1, 0), (1, 4)), ()), (((1, 0), (0, 12)), ()), (((1, 0), (3, 9)), ()), (((1, 0), (2, 3)), ()),
                    (((1, 0), (1, 9)), ()), (((1, 0), (8, 7)), ()), (((1, 0), (4, 2)), ()), (((1, 0), (9, 6)), ()),
                    (((1, 0), (6, 5)), ()), (((1, 0), (5, 3)), ()), (((1, 0), (11, 7)), ()), (((1, 0), (10, 5)), ()),
                    (((1, 0), (7, 0)), ()), (((1, 0), (12, 0)), ()), (((1, 0), (11, 8)), ()), (((1, 0), (7, 13)), ()),
                    (((1, 0), (13, 5)), ()), (((1, 0), (1, 7)), ()), (((1, 0), (3, 4)), ()), (((1, 0), (2, 4)), ()),
                    (((1, 0), (9, 12)), ()), (((1, 0), (8, 4)), ()), (((1, 0), (4, 7)), ()), (((1, 0), (10, 11)), ()),
                    (((1, 0), (9, 1)), ()), (((1, 0), (6, 6)), ()), (((1, 0), (5, 6)), ()), (((1, 0), (11, 2)), ()),
                    (((1, 0), (10, 6)), ()), (((1, 0), (7, 7)), ()), (((1, 0), (12, 5)), ()), (((1, 0), (13, 8)), ()),
                    (((1, 0), (0, 3)), ()), (((1, 0), (1, 2)), ()), (((1, 0), (4, 9)), ()), (((1, 0), (2, 9)), ()),
                    (((1, 0), (8, 1)), ()), (((1, 0), (5, 12)), ()), (((1, 0), (4, 4)), ()), (((1, 0), (10, 12)), ()),
                    (((1, 0), (6, 3)), ()), (((1, 0), (11, 1)), ()), (((1, 0), (12, 10)), ()), (((1, 0), (13, 11)), ()),
                    (((1, 0), (3, 13)), ()), (((1, 0), (1, 13)), ()), (((1, 0), (8, 11)), ()), (((1, 0), (2, 10)), ()),
                    (((1, 0), (9, 10)), ()), (((1, 0), (10, 1)), ()), (((1, 0), (6, 12)), ()), (((1, 0), (11, 12)), ()),
                    (((1, 0), (13, 1)), ()), (((1, 0), (0, 13)), ()), (((1, 0), (3, 8)), ()), (((1, 0), (4, 3)), ()),
                    (((1, 0), (9, 5)), ()), (((1, 0), (5, 2)), ()), (((1, 0), (11, 6)), ()), (((1, 0), (10, 2)), ()),
                    (((6, 8), (7, 3)), ()), (((6, 8), (12, 1)), ()), (((6, 8), (11, 11)), ()), (((6, 8), (7, 12)), ()),
                    (((6, 8), (13, 4)), ()), (((6, 8), (12, 12)), ()), (((6, 8), (0, 10)), ()), (((6, 8), (3, 7)), ()),
                    (((6, 8), (2, 5)), ()), (((6, 8), (1, 11)), ()), (((6, 8), (8, 5)), ()), (((6, 8), (4, 0)), ()),
                    (((6, 8), (10, 8)), ()), (((6, 8), (9, 0)), ()), (((6, 8), (5, 5)), ()), (((6, 8), (11, 5)), ()),
                    (((6, 8), (10, 7)), ()), (((6, 8), (7, 6)), ()), (((6, 8), (12, 6)), ()), (((6, 8), (13, 7)), ()),
                    (((6, 8), (4, 10)), ()), (((6, 8), (3, 2)), ()), (((6, 8), (2, 6)), ()), (((6, 8), (8, 2)), ()),
                    (((6, 8), (5, 11)), ()), (((6, 8), (4, 5)), ()), (((6, 8), (10, 13)), ()), (((6, 8), (9, 3)), ()),
                    (((6, 8), (6, 0)), ()), (((6, 8), (11, 0)), ()), (((6, 8), (7, 5)), ()), (((6, 8), (12, 11)), ()),
                    (((6, 8), (13, 10)), ()), (((6, 8), (0, 1)), ()), (((6, 8), (3, 12)), ()), (((6, 8), (1, 12)), ()),
                    (((6, 8), (8, 12)), ()), (((6, 8), (3, 1)), ()), (((6, 8), (2, 11)), ()), (((6, 8), (9, 9)), ()),
                    (((6, 8), (6, 13)), ()), (((6, 8), (13, 0)), ()), (((6, 8), (12, 8)), ()), (((6, 8), (13, 13)), ()),
                    (((6, 8), (3, 11)), ()), (((6, 8), (2, 1)), ()), (((6, 8), (4, 12)), ()), (((6, 8), (2, 12)), ()),
                    (((6, 8), (9, 4)), ()), (((6, 8), (5, 1)), ()), (((6, 8), (10, 3)), ()), (((6, 8), (7, 2)), ()),
                    (((6, 8), (12, 2)), ()), (((6, 8), (11, 10)), ()), (((6, 8), (13, 3)), ()),
                    (((6, 8), (12, 13)), ()), (((6, 8), (1, 5)), ()), (((6, 8), (0, 11)), ()), (((6, 8), (3, 6)), ()),
                    (((6, 8), (2, 2)), ()), (((6, 8), (8, 6)), ()), (((6, 8), (4, 1)), ()), (((6, 8), (10, 9)), ()),
                    (((6, 8), (9, 7)), ()), (((6, 8), (6, 4)), ()), (((6, 8), (5, 4)), ()), (((6, 8), (11, 4)), ()),
                    (((6, 8), (10, 4)), ()), (((6, 8), (7, 1)), ()), (((6, 8), (6, 11)), ()), (((6, 8), (12, 7)), ()),
                    (((6, 8), (11, 9)), ()), (((6, 8), (13, 6)), ()), (((6, 8), (4, 11)), ()), (((6, 8), (3, 5)), ()),
                    (((6, 8), (2, 7)), ()), (((6, 8), (9, 13)), ()), (((6, 8), (8, 3)), ()), (((6, 8), (5, 10)), ()),
                    (((6, 8), (4, 6)), ()), (((6, 8), (10, 10)), ()), (((6, 8), (9, 2)), ()), (((6, 8), (6, 1)), ()),
                    (((6, 8), (5, 7)), ()), (((6, 8), (11, 3)), ()), (((6, 8), (7, 4)), ()), (((6, 8), (12, 4)), ()),
                    (((6, 8), (13, 9)), ()), (((6, 8), (0, 2)), ()), (((6, 8), (1, 3)), ()), (((6, 8), (8, 13)), ()),
                    (((6, 8), (4, 8)), ()), (((6, 8), (3, 0)), ()), (((6, 8), (2, 8)), ()), (((6, 8), (9, 8)), ()),
                    (((6, 8), (8, 0)), ()), (((6, 8), (5, 13)), ()), (((6, 8), (6, 2)), ()), (((6, 8), (7, 11)), ()),
                    (((6, 8), (12, 9)), ()), (((6, 8), (13, 12)), ()), (((6, 8), (3, 10)), ()), (((6, 8), (8, 10)), ()),
                    (((6, 8), (4, 13)), ()), (((6, 8), (2, 13)), ()), (((6, 8), (9, 11)), ()), (((6, 8), (5, 0)), ()),
                    (((6, 8), (10, 0)), ()), (((6, 8), (12, 3)), ()), (((6, 8), (11, 13)), ()), (((6, 8), (13, 2)), ()),
                    (((6, 8), (1, 4)), ()), (((6, 8), (0, 12)), ()), (((6, 8), (3, 9)), ()), (((6, 8), (2, 3)), ()),
                    (((6, 8), (1, 9)), ()), (((6, 8), (8, 7)), ()), (((6, 8), (4, 2)), ()), (((6, 8), (9, 6)), ()),
                    (((6, 8), (6, 5)), ()), (((6, 8), (5, 3)), ()), (((6, 8), (11, 7)), ()), (((6, 8), (10, 5)), ()),
                    (((6, 8), (7, 0)), ()), (((6, 8), (12, 0)), ()), (((6, 8), (11, 8)), ()), (((6, 8), (7, 13)), ()),
                    (((6, 8), (13, 5)), ()), (((6, 8), (1, 7)), ()), (((6, 8), (3, 4)), ()), (((6, 8), (2, 4)), ()),
                    (((6, 8), (9, 12)), ()), (((6, 8), (8, 4)), ()), (((6, 8), (4, 7)), ()), (((6, 8), (10, 11)), ()),
                    (((6, 8), (9, 1)), ()), (((6, 8), (6, 6)), ()), (((6, 8), (5, 6)), ()), (((6, 8), (11, 2)), ()),
                    (((6, 8), (10, 6)), ()), (((6, 8), (7, 7)), ()), (((6, 8), (12, 5)), ()), (((6, 8), (13, 8)), ()),
                    (((6, 8), (0, 3)), ()), (((6, 8), (1, 2)), ()), (((6, 8), (4, 9)), ()), (((6, 8), (2, 9)), ()),
                    (((6, 8), (8, 1)), ()), (((6, 8), (5, 12)), ()), (((6, 8), (4, 4)), ()), (((6, 8), (10, 12)), ()),
                    (((6, 8), (6, 3)), ()), (((6, 8), (11, 1)), ()), (((6, 8), (12, 10)), ()), (((6, 8), (13, 11)), ()),
                    (((6, 8), (3, 13)), ()), (((6, 8), (1, 13)), ()), (((6, 8), (8, 11)), ()), (((6, 8), (2, 10)), ()),
                    (((6, 8), (9, 10)), ()), (((6, 8), (10, 1)), ()), (((6, 8), (6, 12)), ()), (((6, 8), (11, 12)), ()),
                    (((6, 8), (13, 1)), ()), (((6, 8), (0, 13)), ()), (((6, 8), (3, 8)), ()), (((6, 8), (4, 3)), ()),
                    (((6, 8), (9, 5)), ()), (((6, 8), (5, 2)), ()), (((6, 8), (11, 6)), ()), (((6, 8), (10, 2)), ()),
                    (((6, 9), (7, 3)), ()), (((6, 9), (12, 1)), ()), (((6, 9), (11, 11)), ()), (((6, 9), (7, 12)), ()),
                    (((6, 9), (13, 4)), ()), (((6, 9), (12, 12)), ()), (((6, 9), (0, 10)), ()), (((6, 9), (3, 7)), ()),
                    (((6, 9), (2, 5)), ()), (((6, 9), (1, 11)), ()), (((6, 9), (8, 5)), ()), (((6, 9), (4, 0)), ()),
                    (((6, 9), (10, 8)), ()), (((6, 9), (9, 0)), ()), (((6, 9), (5, 5)), ()), (((6, 9), (11, 5)), ()),
                    (((6, 9), (10, 7)), ()), (((6, 9), (7, 6)), ()), (((6, 9), (12, 6)), ()), (((6, 9), (13, 7)), ()),
                    (((6, 9), (4, 10)), ()), (((6, 9), (3, 2)), ()), (((6, 9), (2, 6)), ()), (((6, 9), (8, 2)), ()),
                    (((6, 9), (5, 11)), ()), (((6, 9), (4, 5)), ()), (((6, 9), (10, 13)), ()), (((6, 9), (9, 3)), ()),
                    (((6, 9), (6, 0)), ()), (((6, 9), (11, 0)), ()), (((6, 9), (7, 5)), ()), (((6, 9), (12, 11)), ()),
                    (((6, 9), (13, 10)), ()), (((6, 9), (0, 1)), ()), (((6, 9), (3, 12)), ()), (((6, 9), (1, 12)), ()),
                    (((6, 9), (8, 12)), ()), (((6, 9), (3, 1)), ()), (((6, 9), (2, 11)), ()), (((6, 9), (9, 9)), ()),
                    (((6, 9), (6, 13)), ()), (((6, 9), (13, 0)), ()), (((6, 9), (12, 8)), ()), (((6, 9), (13, 13)), ()),
                    (((6, 9), (3, 11)), ()), (((6, 9), (2, 1)), ()), (((6, 9), (4, 12)), ()), (((6, 9), (2, 12)), ()),
                    (((6, 9), (9, 4)), ()), (((6, 9), (5, 1)), ()), (((6, 9), (10, 3)), ()), (((6, 9), (7, 2)), ()),
                    (((6, 9), (12, 2)), ()), (((6, 9), (11, 10)), ()), (((6, 9), (13, 3)), ()),
                    (((6, 9), (12, 13)), ()), (((6, 9), (1, 5)), ()), (((6, 9), (0, 11)), ()), (((6, 9), (3, 6)), ()),
                    (((6, 9), (2, 2)), ()), (((6, 9), (8, 6)), ()), (((6, 9), (4, 1)), ()), (((6, 9), (10, 9)), ()),
                    (((6, 9), (9, 7)), ()), (((6, 9), (6, 4)), ()), (((6, 9), (5, 4)), ()), (((6, 9), (11, 4)), ()),
                    (((6, 9), (10, 4)), ()), (((6, 9), (7, 1)), ()), (((6, 9), (6, 11)), ()), (((6, 9), (12, 7)), ()),
                    (((6, 9), (11, 9)), ()), (((6, 9), (13, 6)), ()), (((6, 9), (4, 11)), ()), (((6, 9), (3, 5)), ()),
                    (((6, 9), (2, 7)), ()), (((6, 9), (9, 13)), ()), (((6, 9), (8, 3)), ()), (((6, 9), (5, 10)), ()),
                    (((6, 9), (4, 6)), ()), (((6, 9), (10, 10)), ()), (((6, 9), (9, 2)), ()), (((6, 9), (6, 1)), ()),
                    (((6, 9), (5, 7)), ()), (((6, 9), (11, 3)), ()), (((6, 9), (7, 4)), ()), (((6, 9), (12, 4)), ()),
                    (((6, 9), (13, 9)), ()), (((6, 9), (0, 2)), ()), (((6, 9), (1, 3)), ()), (((6, 9), (8, 13)), ()),
                    (((6, 9), (4, 8)), ()), (((6, 9), (3, 0)), ()), (((6, 9), (2, 8)), ()), (((6, 9), (9, 8)), ()),
                    (((6, 9), (8, 0)), ()), (((6, 9), (5, 13)), ()), (((6, 9), (6, 2)), ()), (((6, 9), (7, 11)), ()),
                    (((6, 9), (12, 9)), ()), (((6, 9), (13, 12)), ()), (((6, 9), (3, 10)), ()), (((6, 9), (8, 10)), ()),
                    (((6, 9), (4, 13)), ()), (((6, 9), (2, 13)), ()), (((6, 9), (9, 11)), ()), (((6, 9), (5, 0)), ()),
                    (((6, 9), (10, 0)), ()), (((6, 9), (12, 3)), ()), (((6, 9), (11, 13)), ()), (((6, 9), (13, 2)), ()),
                    (((6, 9), (1, 4)), ()), (((6, 9), (0, 12)), ()), (((6, 9), (3, 9)), ()), (((6, 9), (2, 3)), ()),
                    (((6, 9), (1, 9)), ()), (((6, 9), (8, 7)), ()), (((6, 9), (4, 2)), ()), (((6, 9), (9, 6)), ()),
                    (((6, 9), (6, 5)), ()), (((6, 9), (5, 3)), ()), (((6, 9), (11, 7)), ()), (((6, 9), (10, 5)), ()),
                    (((6, 9), (7, 0)), ()), (((6, 9), (12, 0)), ()), (((6, 9), (11, 8)), ()), (((6, 9), (7, 13)), ()),
                    (((6, 9), (13, 5)), ()), (((6, 9), (1, 7)), ()), (((6, 9), (3, 4)), ()), (((6, 9), (2, 4)), ()),
                    (((6, 9), (9, 12)), ()), (((6, 9), (8, 4)), ()), (((6, 9), (4, 7)), ()), (((6, 9), (10, 11)), ()),
                    (((6, 9), (9, 1)), ()), (((6, 9), (6, 6)), ()), (((6, 9), (5, 6)), ()), (((6, 9), (11, 2)), ()),
                    (((6, 9), (10, 6)), ()), (((6, 9), (7, 7)), ()), (((6, 9), (12, 5)), ()), (((6, 9), (13, 8)), ()),
                    (((6, 9), (0, 3)), ()), (((6, 9), (1, 2)), ()), (((6, 9), (4, 9)), ()), (((6, 9), (2, 9)), ()),
                    (((6, 9), (8, 1)), ()), (((6, 9), (5, 12)), ()), (((6, 9), (4, 4)), ()), (((6, 9), (10, 12)), ()),
                    (((6, 9), (6, 3)), ()), (((6, 9), (11, 1)), ()), (((6, 9), (12, 10)), ()), (((6, 9), (13, 11)), ()),
                    (((6, 9), (3, 13)), ()), (((6, 9), (1, 13)), ()), (((6, 9), (8, 11)), ()), (((6, 9), (2, 10)), ()),
                    (((6, 9), (9, 10)), ()), (((6, 9), (10, 1)), ()), (((6, 9), (6, 12)), ()), (((6, 9), (11, 12)), ()),
                    (((6, 9), (13, 1)), ()), (((6, 9), (0, 13)), ()), (((6, 9), (3, 8)), ()), (((6, 9), (4, 3)), ()),
                    (((6, 9), (9, 5)), ()), (((6, 9), (5, 2)), ()), (((6, 9), (11, 6)), ()), (((6, 9), (10, 2)), ()),
                    (((7, 9), (7, 3)), ()), (((7, 9), (12, 1)), ()), (((7, 9), (11, 11)), ()), (((7, 9), (7, 12)), ()),
                    (((7, 9), (13, 4)), ()), (((7, 9), (12, 12)), ()), (((7, 9), (0, 10)), ()), (((7, 9), (3, 7)), ()),
                    (((7, 9), (2, 5)), ()), (((7, 9), (1, 11)), ()), (((7, 9), (8, 5)), ()), (((7, 9), (4, 0)), ()),
                    (((7, 9), (10, 8)), ()), (((7, 9), (9, 0)), ()), (((7, 9), (5, 5)), ()), (((7, 9), (11, 5)), ()),
                    (((7, 9), (10, 7)), ()), (((7, 9), (7, 6)), ()), (((7, 9), (12, 6)), ()), (((7, 9), (13, 7)), ()),
                    (((7, 9), (4, 10)), ()), (((7, 9), (3, 2)), ()), (((7, 9), (2, 6)), ()), (((7, 9), (8, 2)), ()),
                    (((7, 9), (5, 11)), ()), (((7, 9), (4, 5)), ()), (((7, 9), (10, 13)), ()), (((7, 9), (9, 3)), ()),
                    (((7, 9), (6, 0)), ()), (((7, 9), (11, 0)), ()), (((7, 9), (7, 5)), ()), (((7, 9), (12, 11)), ()),
                    (((7, 9), (13, 10)), ()), (((7, 9), (0, 1)), ()), (((7, 9), (3, 12)), ()), (((7, 9), (1, 12)), ()),
                    (((7, 9), (8, 12)), ()), (((7, 9), (3, 1)), ()), (((7, 9), (2, 11)), ()), (((7, 9), (9, 9)), ()),
                    (((7, 9), (6, 13)), ()), (((7, 9), (13, 0)), ()), (((7, 9), (12, 8)), ()), (((7, 9), (13, 13)), ()),
                    (((7, 9), (3, 11)), ()), (((7, 9), (2, 1)), ()), (((7, 9), (4, 12)), ()), (((7, 9), (2, 12)), ()),
                    (((7, 9), (9, 4)), ()), (((7, 9), (5, 1)), ()), (((7, 9), (10, 3)), ()), (((7, 9), (7, 2)), ()),
                    (((7, 9), (12, 2)), ()), (((7, 9), (11, 10)), ()), (((7, 9), (13, 3)), ()),
                    (((7, 9), (12, 13)), ()), (((7, 9), (1, 5)), ()), (((7, 9), (0, 11)), ()), (((7, 9), (3, 6)), ()),
                    (((7, 9), (2, 2)), ()), (((7, 9), (8, 6)), ()), (((7, 9), (4, 1)), ()), (((7, 9), (10, 9)), ()),
                    (((7, 9), (9, 7)), ()), (((7, 9), (6, 4)), ()), (((7, 9), (5, 4)), ()), (((7, 9), (11, 4)), ()),
                    (((7, 9), (10, 4)), ()), (((7, 9), (7, 1)), ()), (((7, 9), (6, 11)), ()), (((7, 9), (12, 7)), ()),
                    (((7, 9), (11, 9)), ()), (((7, 9), (13, 6)), ()), (((7, 9), (4, 11)), ()), (((7, 9), (3, 5)), ()),
                    (((7, 9), (2, 7)), ()), (((7, 9), (9, 13)), ()), (((7, 9), (8, 3)), ()), (((7, 9), (5, 10)), ()),
                    (((7, 9), (4, 6)), ()), (((7, 9), (10, 10)), ()), (((7, 9), (9, 2)), ()), (((7, 9), (6, 1)), ()),
                    (((7, 9), (5, 7)), ()), (((7, 9), (11, 3)), ()), (((7, 9), (7, 4)), ()), (((7, 9), (12, 4)), ()),
                    (((7, 9), (13, 9)), ()), (((7, 9), (0, 2)), ()), (((7, 9), (1, 3)), ()), (((7, 9), (8, 13)), ()),
                    (((7, 9), (4, 8)), ()), (((7, 9), (3, 0)), ()), (((7, 9), (2, 8)), ()), (((7, 9), (9, 8)), ()),
                    (((7, 9), (8, 0)), ()), (((7, 9), (5, 13)), ()), (((7, 9), (6, 2)), ()), (((7, 9), (7, 11)), ()),
                    (((7, 9), (12, 9)), ()), (((7, 9), (13, 12)), ()), (((7, 9), (3, 10)), ()), (((7, 9), (8, 10)), ()),
                    (((7, 9), (4, 13)), ()), (((7, 9), (2, 13)), ()), (((7, 9), (9, 11)), ()), (((7, 9), (5, 0)), ()),
                    (((7, 9), (10, 0)), ()), (((7, 9), (12, 3)), ()), (((7, 9), (11, 13)), ()), (((7, 9), (13, 2)), ()),
                    (((7, 9), (1, 4)), ()), (((7, 9), (0, 12)), ()), (((7, 9), (3, 9)), ()), (((7, 9), (2, 3)), ()),
                    (((7, 9), (1, 9)), ()), (((7, 9), (8, 7)), ()), (((7, 9), (4, 2)), ()), (((7, 9), (9, 6)), ()),
                    (((7, 9), (6, 5)), ()), (((7, 9), (5, 3)), ()), (((7, 9), (11, 7)), ()), (((7, 9), (10, 5)), ()),
                    (((7, 9), (7, 0)), ()), (((7, 9), (12, 0)), ()), (((7, 9), (11, 8)), ()), (((7, 9), (7, 13)), ()),
                    (((7, 9), (13, 5)), ()), (((7, 9), (1, 7)), ()), (((7, 9), (3, 4)), ()), (((7, 9), (2, 4)), ()),
                    (((7, 9), (9, 12)), ()), (((7, 9), (8, 4)), ()), (((7, 9), (4, 7)), ()), (((7, 9), (10, 11)), ()),
                    (((7, 9), (9, 1)), ()), (((7, 9), (6, 6)), ()), (((7, 9), (5, 6)), ()), (((7, 9), (11, 2)), ()),
                    (((7, 9), (10, 6)), ()), (((7, 9), (7, 7)), ()), (((7, 9), (12, 5)), ()), (((7, 9), (13, 8)), ()),
                    (((7, 9), (0, 3)), ()), (((7, 9), (1, 2)), ()), (((7, 9), (4, 9)), ()), (((7, 9), (2, 9)), ()),
                    (((7, 9), (8, 1)), ()), (((7, 9), (5, 12)), ()), (((7, 9), (4, 4)), ()), (((7, 9), (10, 12)), ()),
                    (((7, 9), (6, 3)), ()), (((7, 9), (11, 1)), ()), (((7, 9), (12, 10)), ()), (((7, 9), (13, 11)), ()),
                    (((7, 9), (3, 13)), ()), (((7, 9), (1, 13)), ()), (((7, 9), (8, 11)), ()), (((7, 9), (2, 10)), ()),
                    (((7, 9), (9, 10)), ()), (((7, 9), (10, 1)), ()), (((7, 9), (6, 12)), ()), (((7, 9), (11, 12)), ()),
                    (((7, 9), (13, 1)), ()), (((7, 9), (0, 13)), ()), (((7, 9), (3, 8)), ()), (((7, 9), (4, 3)), ()),
                    (((7, 9), (9, 5)), ()), (((7, 9), (5, 2)), ()), (((7, 9), (11, 6)), ()), (((7, 9), (10, 2)), ())]]
        for arg, answer in zip(args, answers):
            self.assertEqual(self.game.available_actions(*arg), answer)

    def test_next_state(self):
        args = [[self.s1, (((0, 0), (0, 2)), ((0, 1),)), 1, "play"], [self.s2, ((0, 1), None), -1, "layout"],
                [self.s3, (((0, 0), (0, 2)), ((0, 1),)), 1, "play"]]
        answers = [[[0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, -1], [1, 1, 0, 0, -1, 1, 1, 0, 0, -1, -1, 1, -1, -1],
                    [1, 0, 0, -1, 0, -1, 1, 1, -1, -1, -1, -1, 0, 1], [1, -1, 1, 0, 0, 1, 1, 0, -1, 0, -1, 1, 0, -1],
                    [1, 1, 0, 1, -1, 0, -1, -1, 0, -1, -1, -1, 0, 0], [1, 1, 0, 1, 1, 1, -1, 0, 0, -1, 0, 0, -1, 0],
                    [1, 0, 0, 0, -1, 0, -1, 1, 1, -1, 0, -1, -1, -1], [-1, 0, 1, 0, 0, 1, 0, 0, 1, -1, 0, 1, 0, 0],
                    [1, 1, 0, 1, 1, 1, -1, 0, 1, 0, 0, -1, -1, -1], [1, 1, 0, 1, 0, 1, -1, 0, 1, 0, 0, 0, 0, -1],
                    [0, 0, -1, 0, 0, -1, -1, 0, 0, -1, -1, 1, 0, -1], [-1, 0, -1, 0, -1, 0, -1, 1, 0, 1, -1, 0, -1, 0],
                    [-1, -1, 1, 0, -1, 0, 1, 1, -1, 0, 1, 1, -1, -1], [-1, 1, -1, -1, 0, 0, 1, 0, -1, 0, -1, 0, 1, 0]],
                   [[-1, -1, 1, -1, -1, -1, 1, 0, 1, -1, 0, -1, -1, 0],
                    [-1, -1, -1, 1, 0, -1, -1, -1, 1, 1, 1, 1, 0, 1], [1, -1, -1, 1, 0, 1, -1, -1, -1, 1, 1, -1, 1, 0],
                    [-1, -1, 0, 1, -1, 1, 0, 0, 0, 0, -1, 0, 1, -1], [0, -1, 1, 1, 0, -1, 0, -1, 0, 1, -1, -1, -1, 1],
                    [-1, 0, -1, 0, 0, -1, 1, 1, 1, 0, 0, 0, -1, 1], [-1, 0, 1, 0, 0, 1, 1, 0, -1, -1, 1, 1, 1, 0],
                    [-1, 1, 0, -1, -1, -1, 1, -1, -1, 0, 1, 0, -1, -1], [-1, 0, 0, 0, 1, -1, 0, -1, -1, -1, 0, 0, 0, 1],
                    [-1, 1, 1, 1, -1, 1, -1, -1, 0, 1, 0, 1, -1, 1], [1, -1, 1, 1, -1, 1, 0, 1, -1, 0, 0, 0, 1, 0],
                    [1, 1, -1, -1, -1, -1, 0, -1, 0, 1, 0, -1, -1, 0], [0, -1, 1, 0, -1, -1, 0, 1, 1, -1, 0, 1, 1, 0],
                    [1, 0, -1, 0, -1, 1, 1, -1, 0, -1, 1, -1, -1, 0]],
                   [[0, 0, 1, 0, 0, 1, -1, 1, -1, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
                    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                    [0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0],
                    [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]
        for arg, answer in zip(args, answers):
            self.assertEqual(self.game.next_state(*arg), answer)

    def test_end_game(self):
        even = [[0 for x in range(14)] for i in range(14)]
        even[2][3], even[3][5] = 1, 1
        even[9][8] = -1
        win = [[0 for x in range(14)] for i in range(14)]
        win[3][3] = -1
        args = [[self.s1, 1, "play"], [even, -1, "play"], [self.s3, -1, "play"], [win, -1, "play"]]
        answers = [0, 0.5, 0, -1]
        for arg, answer in zip(args, answers):
            self.assertEqual(self.game.end_game(*arg), answer)


if __name__ == '__main__':
    unittest.main()
